import 'package:aone_common/router/routes.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:prototype/views/activity/activity_view.dart';
import 'package:prototype/views/home/home_view.dart';

import '../user/user_view.dart';

class MainController extends GetxController {
  static MainController get to => Get.find();

  GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();

  Route? onGenerateRoute(RouteSettings settings) {

    switch (settings.name) {
      case Routes.home:
        return GetPageRoute(
            settings: settings,
            page: () => const HomeView(),
            transition: Transition.leftToRight);
      case Routes.activity:
        return GetPageRoute(
            settings: settings,
            page: () => const ActivityView(),
            transition: Transition.rightToLeft);
      case Routes.user:
        return GetPageRoute(
            settings: settings,
            page: () => const UserView(),
            transition: Transition.rightToLeft);
    }

    return null;
  }
}
